<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Collections" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: lirui
  Date: 2020/7/21
  Time: 19:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>EL表达式</title>
</head>
<body>
<%--获取基本数据类型string--%>
<% pageContext.setAttribute("username", "zhangsan");%>

${username}<br>

<%--自定义对象--%>
<% ArrayList<String> list = new ArrayList<String>();
    Collections.addAll(list, "aaa", "bbb", "ccc");
    pageContext.setAttribute("lists", list);
%>
list集合:${lists} <br>
0索引元素:${lists[0]} <br>
<%--自定义map的值--%>
<%
    HashMap<String, String> map = new HashMap<>();
    map.put("name", "zhangsan");
    map.put("age", "six");
    map.put("adress", "hefei");
    pageContext.setAttribute("map", map);
%>
map集合:${map} <br>
map元素:${map.name}

</body>
</html>
